import {WeaLocaleProvider} from "ecCom";

const getLabel = WeaLocaleProvider.getLabel;

export default {
    custom: {
        validate: ({ value }) => {
            if(!value) return true;

            const regExp = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/;

            if(regExp.test(value)) return true;

            return false;
        },
       error: () => `${getLabel('510153','请输入正确的邮箱地址,格式为xxx@xx.xx')}`
        }
  }